<!--
 * @Description: 入口组件
 * @Author: seadon
 * @LastEditors: Elvis shuaiqy@hotmail.com
 * @Date: 2021-07-06 10:16:41
 * @LastEditTime: 2022-07-24 11:44:19
-->
<template>
	<a-config-provider :locale="LocaleData">
		<template #renderEmpty>
			<no-data />
		</template>
		<div class="portal-container">
			<router-view></router-view>
		</div>
		<!-- <ok-agreement
			v-if="showAgreementDialog === 'true'"
			type="confirm-dialog"
			device="desktop"
			:visible="showAgreementDialog"
			company-name="平台"
			@change="agreementClick"
		></ok-agreement> -->
		<!-- 此处由于vue3.1版本，还不支持wc组件的.语法 -->
		<!-- 新版本提示 -->
		<!-- <NewVersionTips v-if="showNewVersion"></NewVersionTips> -->
	</a-config-provider>
</template>
<script setup lang="ts">
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import enUS from 'ant-design-vue/es/locale/en_US'
import jaJP from 'ant-design-vue/es/locale/ja_JP'
import { LocaleEnum, useI18n } from '@/locales'
import NoData from '@/entry_desktop/components/NoData/NoData.vue'
import { isInnerIframePage } from '@/utils/tabInnerPage'

// import { useAgreement } from '@/hooks/useAgreement'
import { useStore } from 'vuex'
// import NewVersionTips from '@/entry_desktop/components/NewVersionTips/NewVersionTips.vue'
import { corssDomainMessageProcessor } from '@/utils/crossMessageProcessor'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import { onMounted } from 'vue'

const LOCALE_TO_MOMENT = {
	[LocaleEnum.zh]: 'zh-cn',
	[LocaleEnum.en]: 'en',
	[LocaleEnum.ja]: 'ja',
}

const LOCALE_DATA = {
	[LocaleEnum.zh]: zhCN,
	[LocaleEnum.en]: enUS,
	[LocaleEnum.ja]: jaJP,
}

const i18n = useI18n()
const LocaleData = LOCALE_DATA[i18n.locale as LocaleEnum]

const dayjs_new = (window as any).dayjs || dayjs
dayjs_new.locale(LOCALE_TO_MOMENT[i18n.locale as LocaleEnum])
const store = useStore()

// const {
// 	tenantLogo,
// 	tenantName,
// 	showAgreementDialog,
// 	agreementClick,
// 	showNewVersion,
// } = useAgreement()

corssDomainMessageProcessor()
onMounted(() => {
	if ((window as any).BYTELUCK_CHANGE_LAYOUT) {
		;(window as any).BYTELUCK_CHANGE_LAYOUT()
	}
})
</script>

<style lang="less">
html{
	overflow: hidden;
}
body{
	overflow: auto;
}
#app {
	height: 100%;
}
.ant-message {
	z-index: 1052;
}
.portal-container {
	width: 100%;
	background: @rok-bg-default-color;
	// overflow: auto;
	min-height: 100%;
	height: 100%;
}

.ant-layout {
  background: none;
}
</style>
